home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
System
/
SYMBOL
/
Conversions
/
Lists
/
flatten
< prev
next >
Wrap
Text File
|
1998-10-23
|
426b
|
13 lines
flatten s-expression
Flattens s-expressions, that is, if you have a list of symbols and lists, flatten produce a list without nested lists. It works also with vectors, but produces always a list.
(flatten '(a (b c) (d (e) f) g))
--> (a b c d e f g)
(flatten '(1 2 3 #(5 7 9) #(8 10 12) #(11 13 15)))
--> (1 2 3 5 7 9 8 10 12 11 13 15)
(flatten '#(1 2 3 #(5 7 9) #(8 10 12) #(11 13 15)))
--> (1 2 3 5 7 9 8 10 12 11 13 15)